package ynu.edu.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import ynu.edu.entity.User;

import java.util.Map;

@FeignClient("provider-service")
public interface ServiceProviderService {
    
    /**
     * GET方法：根据ID获取用户信息
     */
    @GetMapping("/user/getUserById/{userId}")
    User GetUserById(@PathVariable("userId") Integer userId);
    
    /**
     * GET方法：获取所有用户列表
     */
    @GetMapping("/user/getAllUsers")
    Map<String, Object> getAllUsers();
    
    /**
     * POST方法：创建新用户
     */
    @PostMapping("/user/createUser")
    Map<String, Object> createUser(@RequestBody User user);
    
    /**
     * PUT方法：更新用户信息
     */
    @PutMapping("/user/updateUser/{userId}")
    Map<String, Object> updateUser(@PathVariable("userId") Integer userId, @RequestBody User user);
    
    /**
     * DELETE方法：删除用户
     */
    @DeleteMapping("/user/deleteUser/{userId}")
    Map<String, Object> deleteUser(@PathVariable("userId") Integer userId);
}
